//package comc.springbatch;
//
//
//import org.springframework.batch.core.Job;
//import org.springframework.batch.core.Step;
//import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
//import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
//import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
//import org.springframework.batch.item.ItemProcessor;
//import org.springframework.batch.item.support.CompositeItemProcessor;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.scheduling.annotation.EnableScheduling;
//
//import java.util.ArrayList;
//import java.util.List;
//
////多种Process处理
//@Configuration
//@EnableBatchProcessing
//@EnableScheduling
//public class BatchTest5 {
//    @Autowired
//    public JobBuilderFactory jobBuilderFactory;
//    @Autowired
//    public StepBuilderFactory stepBuilderFactory;
//    @Autowired
//    public DbWriter dbWriter;
//    @Autowired
//    public MyProcess myProcess;
//    @Autowired
//    public MyProcess2 myProcess2;
//    @Autowired
//    public DbReader myReader2;
//
//    @Bean
//    public Job job4() {
//        return jobBuilderFactory.get("jo")
//                .start(step4()).listener(new MyJobListener()).build();
//    }
//
//    @Bean
//    public Step step4() {
//        return stepBuilderFactory.get("st04").
//                chunk(2)
//                .faultTolerant()
//                .listener(new MyChunkListiener())
//                .reader(myReader2.myReader2())
//                .processor(processor())
//                .writer(dbWriter)
//                .build();
//    }
//
//    @Bean
//    public CompositeItemProcessor processor(){
//        CompositeItemProcessor processor=new CompositeItemProcessor();
//        List<ItemProcessor> list=new ArrayList<>();
//        list.add(myProcess);
//        list.add(myProcess2);
//        processor.setDelegates(list);
//        return processor;
//    }
//
//}
